#import <Foundation/Foundation.h>
#import "ElementParser/DocumentRoot.h"
#import "ElementParser/Element.h"
#import "ElementParser/NSString_HTML.h"
#import "SFUWebSource.h"
#import "SFUConstants.h"
#import "SFUContact.h"
#import "ParsingUtilities.h"

//  Reference to ElementParser (third party source) used in this class.
//
//  Created by Lee Buck on 4/21/09.
//  Copyright 2009 Blue Bright Ventures. All rights reserved.
//
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.

//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.

//	Commercial licences without many of the obligations of GPL 
//	are available for a nominal fee at sales@touchtankapps.com.

//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.

/**
 * An SFUDirectorySource is an object representing the SFU business
 * faculty & staff directory.
 *
 * Refers to the website "http://business.sfu.ca/directory.php".
 * Conforms to the WebParsable protocol.
 *
 * Code used within this class and the supporting API was written by Lee Buck.
 * The supporting API can be found in ./ElementParser folder.
 *
 * @author      James Lin
 * @author      Lee Buck
 * @version     1.0.4
 * @since       1.0.4
 * @see         SFUWebSource
 */
@interface SFUDirectorySource : SFUWebSource {
	NSMutableURLRequest*      request;      // The URL request for connection
	NSURLConnection*          connection;   // The URL connection
	NSMutableData*            receivedData; // Data received from the connection
	DocumentRoot*             document;     // Root node of the parse tree
	NSArray*                  tempContacts; // Temporary contact list
}

@property (nonatomic, retain) NSMutableURLRequest* request;
@property (nonatomic, retain) NSURLConnection* connection;

/**
 * Initialize the SFU directory source with a URL.
 *
 * The connection is asynchronous.
 *
 * @param theDelegate      the delegate to handle connection events
 * @return                 the initialized SFUDirectorySource
 * @see	                   SFUConnectionDelegate
 */
- (id) initWithDelegate:(id<SFUConnectionDelegate>)theDelegate;

@end
